package com.cxz.study.boot.config;

import com.cxz.study.domain.order.OrderDomainService;
import com.cxz.study.domain.order.OrderEventPublisher;
import com.cxz.study.domain.order.OrderRepository;
import com.cxz.study.domain.order.orderId.OrderIdMapper;
import com.cxz.study.domain.order.service.InventoryService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @className: OrderConfig
 * @author: ocxz1
 * @date: 2025/6/15 下午5:48
 * @Version: 1.0
 * @description: ddd-struct3
 */
@Configuration
public class OrderConfig {

    @Bean
    public OrderDomainService orderDomainService(
            OrderRepository orderRepository,
            OrderEventPublisher eventPublisher,
            InventoryService inventoryService) {
        return new OrderDomainService(orderRepository, eventPublisher, inventoryService);
    }

    @Bean
    public OrderIdMapper orderIdMapper() {
        return OrderIdMapper.INSTANCE;
    }
}
